package ar.com.vates.ejercicio2;
import java.util.Random;

public class Escribe extends Thread {

	private Contenedor contenedor;
	
	public Escribe(Contenedor c){
		this.contenedor = c;
	}
	
	public void run(){
		Random numAleatorio= new Random();
		
		for(int i=0 ; i<10; i++){
			contenedor.setNumber(numAleatorio.nextInt(20));
			try{
				sleep(1000*(numAleatorio.nextInt(10)+1));
			}catch(InterruptedException e){
				
			}
		}
	}
	public  String toString(){
		return "HiloEscribe";
	}

}
